import $service from '../../service';
Component({
  properties: {
    // 弹窗标题
    isShow: {
      type: Boolean,
      value: true
    },
    privacyName: {
      type: String,
      value: ''
    }
  },
  data: {
    hospitalName: '互联网医院'
  },
  lifetimes:{
    attached() {
      this.setData({
        hospitalName: wx.getStorageSync('hospitalName') || '互联网医院'
      })
    }
  },
  methods: {
     //隐藏弹框
     hideDialog() {
      this.setData({
        isShow: !this.data.isShow
      })
    },
    //展示弹框
    showDialog() {
      this.setData({
        isShow: !this.data.isShow
      })
    },
    viewAgreement() {
      wx.openPrivacyContract({
        fail: (err) => { $service.showToast(err)}, // 打开失败
        })
    },

    refuse() {
      this.hideDialog()
      wx.reLaunch({
          url: '/pages/user_index/user_index'
      })
    }
  }
})